import { ConstVar } from "@/utils/base";

/**
 * 页面权限类型
 */
export const PAGE_CODE = {
  /**
   * 任何人都可以访问的页面
   * 比如: 登录页面
   */
  PUBLIC: Symbol("public"),
  /**
   * 任何具有登录身份的都可以访问的页面
   */
  USER: Symbol("user"),
  /**
   * 需要有对应的页面权限才可以访问的页面
   */
  ROLE: Symbol("role")
}

/**
 * 接口通用码
 */
export const REQUEST_CODE = new ConstVar({
  OK: {
    code: "0",
    name: "正常"
  },
  EXCEPTION: {
    code: "50001",
    name: "错误"
  },
  AUTH_INVALID: {
    code: "40001",
    name: "当前登录用户已失效，请重新授权"
  },
  TOKEN_INVALID: {
    code: "40002",
    name: "无效的令牌"
  },
  STATE_INVALID: {
    code: "40003",
    name: "防重状态无效"
  },
  DEVICE_TYPE_INVALID: {
    code: "40004",
    name: "无效的设备类型"
  },
  INVALID_CERTIFICATION_TYPE: {
    code: "40005",
    name: "无效的认证类型"
  },
  LOGIN_STATE_INVALID: {
    code: "40006",
    name: "无效的登录状态"
  }
})

/**
 * 身份权限
 */
export const GRANT_TYPE = new ConstVar({
  /**
   * 通常来说不会出现这个code
   */
  "FANG_KE": {
    code: 0,
    name: "访客"
  },
  /**
   * 抖音code授权的
   * 默认都是这个 , 类似于抖音方可
   */
  "DY_CODE": {
    code: 1,
    name: "抖音code授权"
  },
  /**
   * （手机号用户、普通C端用户）
   */
  "SHOU_JI": {
    code: 30,
    name: "消费者"
  },
  /**
   * 普通P端用户、主播、合作号、员工号、推广员
   */
  "HE_ZUO": {
    code: 40,
    name: "合作伙伴"
  },
  /**
   * 普通B端用户、商家、公司
   */
  "JING_YING": {
    code: 60,
    name: "经营者"
  },
  /**
   * 紫博光彦、运维
   */
  "HOU_TAI": {
    code: 80,
    name: "后台管理"
  },
  "ADMIN": {
    code: 99,
    name: "超级用户"
  },
})



/**
 * 菜单类型
 */
export const MENU_TYPE = new ConstVar({
  BB: {
    code: "1",
    name: "文件夹"
  },
  CD: {
    code: "2",
    name: "菜单"
  },
  LJ: {
    code: "3",
    name: "链接"
  },
})

/**
 * 微信菜单类型
 */
export const EDIT_MENU_TYPE = new ConstVar({
  WY: {
    code: 'View',
    name: '跳转网页'
  },
  XCX: {
    code: 'MiniProgrampage',
    name: '跳转小程序'
  },
})


/**
 * 性别
 */
export const SEX = new ConstVar({
  NAN: {
    code: '男',
    name: '男'
  },
  NV: {
    code: '女',
    name: '女'
  },

})

/**
 * 卡券类型
 */
export const COUPON_TYPE = new ConstVar({
  CP: {
    code: '1',
    name: '产品'
  },
  SH: {
    code: '2',
    name: '售后'
  },
  LW: {
    code: '3',
    name: '礼品'
  },
})
/**
 * 使用人员类型
 */
export const COUPON_ACCOUNT_TYPE = new ConstVar({
  CZ: {
    code: '0',
    name: '车主'
  },
  JXS: {
    code: '1',
    name: '经销商'
  },
})
/**
 * 使用类型
 */
export const PRICE_TYPE = new ConstVar({
  JE: {
    code: '1',
    name: '金额'
  },
  SL: {
    code: '2',
    name: '数量'
  },
})
/**
 * 使用类型
 */
export const VALID_TYPE = new ConstVar({
  TS: {
    code: '1',
    name: '天数'
  },
  RQ: {
    code: '2',
    name: '日期'
  },
})
/**
 * ====产品发布=====
 */
/**
 * 参与人类型
 */
export const ACCOUNT_TYPE = new ConstVar<{
  urlCode: string
}>({
  W: {
    code: '0',
    name: '浏览',
    urlCode: "CHZX"
  },
  FCZ: {
    code: '3',
    name: '新客户',
    urlCode: "CHZX"
  },
  CZ: {
    code: '1',
    name: '老客户',
    urlCode: "CHZX"
  },
  ZCYH: {
    code: '4',
    name: '注册用户',
    urlCode: "CHZX"
  },
  JXS: {
    code: '2',
    name: '经销商',
    urlCode: "CSZX"
  },
})
/**
 * 发布类型
 */
export const ACT_TYPE = new ConstVar({
  ZX: {
    code: '1',
    name: '文章'
  },
  HD: {
    code: '2',
    name: '活动'
  },
  SP: {
    code: '3',
    name: '视频'
  },
})
/**
 * 参与范围类型
 */
export const RANGE_TYPE = new ConstVar({
  W: {
    code: '0',
    name: '无'
  },
  QY: {
    code: '1',
    name: '区域'
  },
  MD: {
    code: '2',
    name: '门店'
  },
})
export const RANGE_TYPE_NW = new ConstVar({
  QY: {
    code: '1',
    name: '区域'
  },
  MD: {
    code: '2',
    name: '门店'
  },
})
export const REG_RANGE_TYPE = new ConstVar({
  QY: {
    code: '1',
    name: '区域'
  },
  MD: {
    code: '2',
    name: '门店'
  },
})
/**
 * 互动类型
 */
export const JOIN_TYPE = new ConstVar({
  W: {
    code: '0',
    name: '无'
  },
  BM: {
    code: '1',
    name: '报名'
  },
  QD: {
    code: '2',
    name: '签到'
  },
})
/**
 * 互动奖励类型
 */
export const JOIN_AWARD_TYPE = new ConstVar({
  W: {
    code: '0',
    name: '无'
  },
  KQ: {
    code: '1',
    name: '卡券'
  }
})
/**
 * 转发奖励类型
 */
export const FOR_AWARD_TYPE = new ConstVar({
  W: {
    code: '0',
    name: '无'
  },
  KQ: {
    code: '1',
    name: '卡券'
  }
})
/**
 * 微信提示
 */
export const DATA_DICTIONCTY = new ConstVar({
  ZCTS: {
    code: '1',
    name: '客户注册提示',
    value: ""
  },
  KHGG: {
    code: '2',
    name: '客户首页提示',
    value: ""
  },
  KHTS: {
    code: '3',
    name: '客户我的提示',
    value: ""
  },
  JXSGG: {
    code: '4',
    name: '经销商首页提示',
    value: ""
  },
})